<template>
	<view>
		<!--公司信息 开始-->
		<view>
			<view class="showtitle">公司信息</view>
			<uni-section title="公司信息" type="line" padding>
				<uni-grid :column="3" :square="false" :highlight="true">
					<uni-grid-item v-for="ci in companyInfo" v-bind:key="ci.id">
						<view class="grid-item-box" style="margin-top: 14px;">
							<text class="text">{{ ci.companyname }}</text>
						</view>
					</uni-grid-item>
				</uni-grid>
			</uni-section>
		</view>
		<!--公司信息 结束-->
		
		<br>
		<br>
		
		<!--联赛信息 开始-->
		<view>
			<view class="showtitle">联赛信息</view>
			<uni-table border stripe emptyText="暂无更多数据">
				<uni-tr>
					<uni-th width="90">联赛id</uni-th>
					<uni-th width="100">联赛类型</uni-th>
					<uni-th>每赛季轮次</uni-th>
				</uni-tr>
				<uni-tr v-for="li in leagueInfo" v-bind:key="li.id">
					<uni-td>{{li.leagueid}}</uni-td>
					<uni-td>{{li.leaguetype}}</uni-td>
					<uni-td>{{li.rounds}}</uni-td>
				</uni-tr>
			</uni-table>
		</view>
		<!--联赛信息 结束-->
		
		<br>
		<br>
		
		<!--赛季信息 开始-->
		<view>
			<view class="showtitle">赛季信息</view>
			<uni-section title="赛季信息" type="line" padding>
				<uni-grid :column="3" :square="false" :highlight="true">
					<uni-grid-item v-for="si in seasonInfo" v-bind:key="si.id">
						<view class="grid-item-box" style="margin-top: 18px;">
							<text class="text">{{ si.season }}</text>
						</view>
					</uni-grid-item>
				</uni-grid>
			</uni-section>
		</view>
		<br>
		<br>
		<!--赛季信息 结束-->
		
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				companyInfo:[],
				leagueInfo:[],
				seasonInfo:[]
			}
		},
		onLoad() {

		},
		methods: {
			//获取公司信息
			loadCompanyInfo(){
				uni.request({
					url:"/api/20001/info/companyinfo/list",
					success: (res) => {
					    this.companyInfo = res.data.data;
					},
				});
			},
			
			//获取联赛信息
			loadLeagueInfo(){
				uni.request({
					url:"/api/20001/info/leagueinfo/list",
					success: (res) => {
					    this.leagueInfo = res.data.data;
					},
				});
			},
			
			//获取赛季信息
			loadseasonInfo(){
				uni.request({
					url:"/api/20001/info/seasoninfo/list",
					success: (res) => {
					    this.seasonInfo = res.data.data;
					},
				});
			}
		},
		
		created() {
			this.loadCompanyInfo();//获取公司信息
			this.loadLeagueInfo();//获取联赛信息
			this.loadseasonInfo();//获取赛季信息
		}
	}
</script>

<style>
	.showtitle{
		font-size: 18px;
		font-weight: bold;
		color: brown;
	}
</style>
